Mundus

Contents:
    Introduction
    History
    User interface
    Basic concepts
    Data layer
    Service layer
    View layer

## Introduction:

Mundus is an opensource light-weight sandbox desktop game (on how to install it, refer to the [README of the repository]). In it, you can explore, fight with creatures, build things or dig up the whole ground. If you choose survival mode, gathering resources and crafting better equipment are essential. If you prefer creating things, creative mode is for you.
[IMAGES](Note: may vary between os)

It all started as my exam project for module 7 of the course IT-kariera. Well, the concept has existed ever since my first lessons in the course. BitSpace and BitSpace 2.0 were short-lived attempts at implimenting this idea but with Mundus I decided it was time to do this once and for all.

Although it began as an exam project, I will continue working on for the foreseeable future with two goals in mind. First and foremost, to create a fun game and second of all: to make it avalable to be downloaded directly on linux (from AUR, ...).

I am doing this project by myself, from code to textures. It contains more than 2000 lines of code, which I have written in the past months.

# History

It all started on the 8th of march 2020. This was our first lecture in module 7 of the IT-kariera course and it was announced that for this exam we will be doing a prokect. From that point on, for the next two-three days I brainstormed different ideas and remembered my idea from the beginning of the course - a sandbox game, compromised of squares (nothing revolutionnary, but still, I liked it).

For the next one-two weeks I explored different game engines / user interfaces. I started with Unity, but orginally I had about 2 months to complete it, and after a couple of days, I gave up. After that I looked into Gtk, and more precisely it's C# implementation GtkSharp 2.0. I decided that it was good enough and I got the hang of it in a couple of days.

After that I started planning. For the next week and a half I got a notebook and started taking notes on ideas all day long.

Then started the spring school break. That was a good time to start coding the program. I worked really really hard, some days I worked for 8 hours without stop. It was almost the end of the break, but it got extended by a week. I continued working.

But then, the COVID-19 situation happened. I wasn't able to continue working on it for a while, because I was burned out from the spring break and, in the beginning, there was an incredible amount of chaos with online education that I took upon myself to organize as much as I can. Because of that I didn't do any serious work for about 3 weeks.

Until I finished the exam version, this pattern continued. I kept having a week or two where I worked really hard and another week or two where I rested.

In the end, I had a finished product. It was more of a tech demo than a finished programme, but that was fine. (Note: as of 20.05.2020 i still haven't technically finished it, there are still a few things I need to do)

## User interface

many screnshots

## Basic concepts:

Despite the fact that I tried my best to make the game as intuitive as possible, there are things you need to understand about how it works.

# Tiles
The ingame world (map) is composed of squares, called tiles, everything is a type of tile. The main purpose of tiles is to hold textures (amongst other important information). There are two main categories of tiles: items and mobs. Mobs (mobile object for short) are the creatures in the game. On the contrary, items are everything else, from the tools, to the trees. There is only one type of mob tiles and that is MobTiles. 

All mobs have a couple of properties: their health (if it drops to or below 0, they die), defence (reduces or completely negates certain amounts of damage), inventory, random movement qualifier (used for random movement around the world), item that is dropped upon death (health <= 0) and the superlayer they are currenly in.

Items, however, are divided into: Structure, Ground, Material, Tool and Gear.

Material tiles are primarly used for crafting. Some tools are "consumable", meaning they can be consumed by the mob, which removes them from the inventory and changes the value of some property. In your inventory they are surrounded in oringe [color the word].

Gear tiles are something you equip (in your accessories and gear inventories) that boost your stats. In your inventory they are surrounded in purple [color the word].

Ground tiles are the tiles on the superlayer ground. For example, grass, water, sand are all ground tiles, because structures and mobs will be walking on top of them.

Structure tiles are tiles that can be placed in the world. For example, a tree is a type of structure tile. Some of them can be picked up. For example, a ladder is something you can have in your inventory, but something you can also place. They have a health and a dropped item (they drop their dropped item each time they're hurt). In your inventory they are surrounded in red [color the word].

Tool tiles are used for interracting (changing) the environment of the world. There are four types: Shovel, Axe, Pickaxe and Sword. 
With a shovel you can dig up (remove) ground tiles from ground layer (see Layers and superlayers). Axes are used to break (remove) wooden structures (trees, ladders, ...). Pickaxes are used for breaking (removing) structures made from hard materials (rocks, boulders, ...). 

Tools aren't interchangeable, you can't use an axe to mine a bouder or an axe to kill a cow. In your inventory they are surrounded in blue [color the word].

# Layers and superlayers
The ingame world (map) is composed of superlayers. Superlayers represent each elevation level in the world. There are in total 5 superlayers (not all are implimented): Space Sky Land Underground ???.

Each superlayer is composed of 3 layers: Structure, Mob, Ground. Each one of them contains a specific type of tiles, structure tiles are only stored in "strucutre" layer, ground tiles only in "ground" layer and mob tiles only in "mob" layer. Even though, they are different layers, there are some rules for the interraction between them:
1. Mobs can't be on top of structures (except if the structure is marked as "walkable")
2. Structures cannot be placed on top of mobs (except if the strucure is marked as "walkable")
3. Structures cannot be placed on top of holes (empty spots in the ground layer), except if they are "climable", in which case they will be placed on the structure layer on the superlayer below. Mobs also cannot be on top of holes (they fall to the superlayer below).

# Inventory
Each mob can store certain amount of item tiles. That is done in it's inventory. The inventory is comprised of 4 parts: hotbar, items, accessories and gear.

Hotbar can have all item tiles (except groundtiles). It should be used for the most important items in the inventory. In the UI you don't need to have the inventory menu open to use items from the hotbar.

Items is used as a bulk storage. It can hold any type of item tile and is the largest part of the inventory.

Accessories and gear are used only to store gear tiles.

# Crafting
Creating different item tiles is done through crafting. Each craftable item requires from one to five different materials in different quantities. The item tiles must be inside the "items" part of your inventory.

# Event logs
Certain actions you do in the game are stored in memory as messages (logs). They are also used to give you information that you couldn't get otherwise. For example, there is a log if you can't climb up a superlayer because a mob is blocking the way, or when you damage/kill a structure or mob.
